﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlChiNhanh.ascx.cs"
    Inherits="UserControl_ControlChiNhanh" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<script type="text/javascript">
    function pageLoad() {
        

       
        $("#<%= btnSave.ClientID %>").click(function () {
            if ($("#<%= txtMaSo.ClientID %>").val().length > 0 && $("#<%= txtName.ClientID %>").val().length > 0) {
                $.blockUI({ css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#000',
                    '-webkit-border-radius': '10px',
                    '-moz-border-radius': '10px',
                    opacity: .5,
                    color: '#fff'
                }
                });
            }
        });

      
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }
    }

</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <div class="direct_container_right_titletop">
            Quản lý thông tin nhà phân phối
        </div>
        <hr />
        <!-- Button chuc nang-->
        <div class="direct_container_main">
           <%-- <asp:ImageButton ID="imgBtnAdd" CausesValidation="false" ImageUrl="~/Images/add.png"
                Width="32px" Height="32px" runat="server" OnClick="imgBtnAdd_Click" />--%>
            
        </div>
        <!-- End Button chuc nang-->
        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" BackColor="#CCFFFF"
            Font-Names="Arial" Width="100%">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Nhập thông tin" TabIndex="0">
                <ContentTemplate>
                    <!-- Content main-->
                    <div class="direct_container_main">
                        <div class="direct_container_form_right">
                            <table border="0" width="100%">
                                <tr>
                                    <td colspan="4" align="center">
                                        <asp:Label ID="lblMsg" runat="server" Visible="false" BackColor="Silver" ForeColor="Blue" Font-Bold="true" Font-Italic="true"></asp:Label>
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td align="right" width="10%">
                                        <p class="direct_label">
                                            Mã nhà phân phối</p>
                                    </td>
                                    <td align="left" width="90%">
                                        <asp:TextBox ID="txtMaSo" CssClass="input_code" ReadOnly="true" runat="server"></asp:TextBox>
                                         <asp:RequiredFieldValidator ControlToValidate="txtMaSo" Display="None"  ID="RFVName" runat="server" ErrorMessage="Phải nhập mã chi nhánh">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RFVName" ID="ValidatorCalloutExtender1" runat="server">
                                </cc1:ValidatorCalloutExtender>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <p class="direct_label">
                                            Tên nhà phân phối</p>
                                    </td>
                                    <td align="left">
                                        <asp:TextBox ID="txtName" CssClass="input_full" runat="server"></asp:TextBox>
                                         <asp:RequiredFieldValidator ControlToValidate="txtName" Display="None"  ID="RequiredFieldValidator1" runat="server" ErrorMessage="Phải nhập tên chi nhánh">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator1" ID="ValidatorCalloutExtender2" runat="server">
                                </cc1:ValidatorCalloutExtender>

                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">
                                        <p class="direct_label">
                                            Thuộc trung tâm</p>
                                    </td>
                                    <td align="left">
                                        <asp:DropDownList ID="ddlChiNhanh" runat="server">
                                        <asp:ListItem Text="Fimex" Selected="True" Value="FM_00000001"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                </tr>
             
                                    <tr>
                                        <td align="right">
                                            <p class="direct_label">
                                                Địa chỉ</p>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="txtDiaChi" CssClass="input_full" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <p class="direct_label">
                                                Điện thoại</p>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="txtPhone" CssClass="input_full" runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                     <tr>
                                        <td align="right">
                                            <p class="direct_label">
                                                Số Fax</p>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="txtFax" CssClass="input_full" runat="server"></asp:TextBox>
                                             <asp:Button ID="btnSave" runat="server" Text="Lưu" onclick="btnSave_Click"/>
                                        </td>
                                    </tr>
                        
                            </table>
                        </div>
                    </div>
                    <!-- EndContent main-->
                </ContentTemplate>
            </cc1:TabPanel>
            <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
                <ContentTemplate>
                    <div class="direct_container_main">
                        <div class="direct_container_form_right">
                            <table border="0" width="100%">
                               
                                
                               
                                <tr>
                                    <td>
                                   

                                      <asp:GridView ID="grvBranch" runat="server" AutoGenerateColumns="False" 
                                                        DataKeyNames="Sitecode" EnableModelValidation="True" 
                                                        onrowcommand="grvBranch_RowCommand" AllowPaging="true"  PageSize="10"
                                                        onpageindexchanging="grvBranch_PageIndexChanging">
                                                        <Columns>
                                                            <asp:TemplateField HeaderText="Stt">
                                                                <HeaderTemplate>
                                                                    STT
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="50px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Mã chi nhánh">
                                                                <HeaderTemplate>
                                                                    Mã chi nhánh
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                  
                                                                    <asp:Label ID="lblMaSo" runat="server" Text='<%# Eval("Sitecode")%>'></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Tên chi nhánh">
                                                                <HeaderTemplate>
                                                                    Tên chi nhánh
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("Sitename")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Số điện thoại">
                                                                <HeaderTemplate>
                                                                    Số điện thoại
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("Tel")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Số Fax">
                                                                <HeaderTemplate>
                                                                    Số Fax
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("fax")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="150px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField HeaderText="Thuộc trung tâm">
                                                                <HeaderTemplate>
                                                                    Thuộc chi nhánh
                                                                </HeaderTemplate>
                                                                <ItemTemplate>
                                                                    <%# Eval("Belong")%>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" Width="200px" />
                                                                <ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
                                                            </asp:TemplateField>
                                                             <asp:TemplateField>
                                                                 <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                                    CommandName="chon" Height="25px" Width="25px" ImageUrl="~/Images/check.png" />
                                                                </ItemTemplate>
                                                                <ControlStyle BackColor="White" BorderColor="White" />
                                                                <FooterStyle BackColor="White" BorderColor="White" />
                                                                <HeaderStyle BackColor="White" BorderColor="White" />
                                                                <ItemStyle BackColor="White" BorderColor="White" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>

                                    </td>
                                </tr>
                               
                            </table>
                        </div>
                    </div>
                    
                </ContentTemplate>
            </cc1:TabPanel>
              <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Hướng dẫn" TabIndex="2">
             <ContentTemplate>
             <div class="direct_container_main">
             <div class="direct_container_form_right">
               <table border="0" width="100%">
                 <tr>
                          <td width="12%" align="right"><p class="direct_label">Mô tả:</p></td>
                                    <td width="88%" align="left">
                                        Quản lý thông tin 02 nhà phân phối DKSH và Nhật Minh Dương
                                    </td>
                 </tr>
                 
                  <tr>
                          <td colspan="2">1.Nếu muốn chỉnh sửa thì đầu tiên các bạn click vào tag Tìm kiếm,chọn nhà phân phối
                            muốn sửa đổi,sau đó bạn cập nhật thông tin ở bên tag Nhập thông tin và click nút lưu</td>
                                   
                 </tr>
               </table>
                                                            </div>
            </div>
                                                            </ContentTemplate>
                                                            </cc1:TabPanel>
        </cc1:TabContainer>
         <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>
    </ContentTemplate>
</asp:UpdatePanel>

